home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / linux / tools / amiga / setpath.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-06-14  |  629 b   |  26 lines

  1. /*
  2.  * Set the environment variable PATH from the system PATH
  3.  */
  4. address command
  5. "path > pipe:path"
  6. call open pathout,"pipe:path",'read'
  7. path=""
  8. sep=""
  9. component = readln(pathout)
  10. do while component ~= ""
  11.    select
  12.       when component = "Current_directory" then path = path || sep || "."
  13.       when component = "Ram Disk:" then path = path
  14.       otherwise
  15.          parse var component head ':' rest
  16.          if rest = ""
  17.          then path = path || sep || '/' || head
  18.          else path = path || sep || '/' || head || '/' || rest
  19.    end
  20.  
  21.    sep = ":"
  22.    component = readln(pathout)
  23. end
  24. call close pathout
  25. 'setenv PATH '||path
  26.